package org.ekstrabilet.game.gui;

import java.awt.CardLayout;

import javax.swing.JPanel;

import org.ekstrabilet.stadium.StadiumPricesPane;

public class AddGameTab {

	public static String GAME = "Games";
	public static String PRICE = "Prices";
	
	private JPanel pane;
	private GameEditPane gameEditPane;
	private StadiumPricesPane stadiumPricesPane;

	public AddGameTab() {
		init();
	}
	
	private void init() {
		
		gameEditPane = new GameEditPane(this);
		stadiumPricesPane = new StadiumPricesPane(this);
		
		pane = new JPanel(new CardLayout());
		pane.add(gameEditPane.getPane(), GAME);
		pane.add(stadiumPricesPane, PRICE);
		switchPane(GAME);
	}
	
	public void switchPane(String card) {
		
		CardLayout cl = (CardLayout) pane.getLayout();
		if(GAME.equals(card)) {
			cl.show(pane, GAME);
			return;
		}
		if(PRICE.equals(card)) {
			cl.show(pane, PRICE);
			return;
		}
	}
	
	public JPanel getPane() {
		return pane;
	}

	public void setPane(JPanel pane) {
		this.pane = pane;
	}

	public GameEditPane getGameEditPane() {
		return gameEditPane;
	}

	public void setGameEditPane(GameEditPane gameEditPane) {
		this.gameEditPane = gameEditPane;
	}

	public StadiumPricesPane getStadiumPricesPane() {
		return stadiumPricesPane;
	}

	public void setStadiumPricesPane(StadiumPricesPane stadiumPricesPane) {
		this.stadiumPricesPane = stadiumPricesPane;
	}
	
}
